#coding=utf-8

import epics
import tornado
from controller.BaseHandler import BaseHandler
from controller import cagetDouble
class Handler(BaseHandler):

    @tornado.web.asynchronous
    @tornado.gen.coroutine
    def get(self):
        # 返回内容
        self.tplAssigns['values'] = []
        TI4203a = yield self.backend.submit(cagetDouble, 'EXP_TB_CR:HYD:TI4203a:TMP:ai')
        self.tplAssigns['values'].append(['耦合液氢慢化器进口温度', TI4203a,  'K'])
        TI4204a = yield self.backend.submit(cagetDouble, 'EXP_TB_CR:HYD:TI4204a:TMP:ai')
        self.tplAssigns['values'].append(['耦合液氢慢化器出口温度', TI4204a, 'K'])
        TI4201a = yield self.backend.submit(cagetDouble, 'EXP_TB_CR:HYD:TI4201a:TMP:ai')
        self.tplAssigns['values'].append(['退耦合液氢慢化器进口温度', TI4201a, 'K'])
        TI4202a = yield self.backend.submit(cagetDouble, 'EXP_TB_CR:HYD:TI4202a:TMP:ai')
        self.tplAssigns['values'].append(['退耦合液氢慢化器出口温度', TI4202a, 'K'])
        PI4145 = yield self.backend.submit(cagetDouble, 'EXP_TB_CR:HYD:PI4145:PRS:ai')
        self.tplAssigns['values'].append(['换热器进口压力', PI4145, 'bar'])
        PI4141 = yield self.backend.submit(cagetDouble, 'EXP_TB_CR:HYD:PI4141:PRS:ai')
        self.tplAssigns['values'].append(['换热器出口压力', PI4141, 'bar'])
        TI4105a = yield self.backend.submit(cagetDouble, 'EXP_TB_CR:HYD:TI4105a:TMP:ai')
        self.tplAssigns['values'].append(['换热器进口温度', TI4105a, 'K'])
        TI4101a = yield self.backend.submit(cagetDouble, 'EXP_TB_CR:HYD:TI4101a:TMP:ai')
        self.tplAssigns['values'].append(['换热器出口温度', TI4101a, 'K'])
        self.render("ezca/temper.html", **self.tplAssigns)
